<template>
  <div>
    <van-nav-bar
      title="热门电台"
      left-text="返回"
      left-arrow
      @click-left="$router.go(-1)"
    />
    <div class="d-flex">
      <div v-for="v in list" :key="v.id">
        <div class="pic">
          <van-image :src="v.picUrl" round>
            <template v-slot:loading>
              <span style="font-size: 12px">加载中... </span>
            </template>
          </van-image>
          <div class="hiddle" style="">{{ v.name }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "CloudMusicIndex",

  data() {
    return {
      list: [],
    };
  },
  mounted() {
    this.$request("get", "/dj/hot").then(({ djRadios = [] }) => {
      this.list = djRadios;
    });
  },

  methods: {},
};
</script>

<style scoped>
.pic {
  width: 100px;
  opacity: 0.7;
}
.pic img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.d-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 1rem;
}
.d-flex > div {
  padding: 0.3rem 0;
}
.hiddle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
</style>
